<?php

namespace Modules\Groupon\Entities;

use Modules\Core\Entities\BaseEntity as Model;
use ThrowException;

class GrouponMember extends Model
{
    protected $guarded = [];
    protected $table = 'groupon_members';

    static public $resourceName = '参团成员';

    public function scopePaid($query)
    {
        return $query->where('status', 1);
    }

    public function order()
    {
    	return $this->belongsTo('\Modules\Order\Entities\ProductOrder', 'order_id');
    }

    public function record()
    {
        return $this->belongsTo('\Modules\Groupon\Entities\GrouponRecord', 'groupon_record_id');
    }

    public function base_user()
    {
    	return $this->belongsTo('\Modules\User\Entities\User', 'user_id');
    }
}
